<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <div id='app' v-cloak>
    <cpn></cpn>
  </div>

  <!-- 1.使用script 标签类型为text/x-template-->
  <!-- <script type="text/x-template" id="cpn">
    <div>
      <h2>我是标题</h2>
      <p>哈哈哈哈哈哈</p>
    </div>
  </script> -->

  <!-- 2.使用template模板标签 -->
  <template id="cpn">
    <div>
      <h2>我是模板标签</h2>
      <p>我是内容，哈哈</p>
    </div>
  </template>
  <script src='../js/vue.js'></script>
  <script>
    // 1.注册全局组件
    Vue.component('cpn', {
      template: '#cpn'
    })

    const app = new Vue({
      el: '#app',
      data: {
        message: 'hello Vue'
      }
    })
  </script>
  <style>
    [v-cloak] {
      display: none;
    }
  </style>
</body>

</html>